home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 March / maximum-cd-2000-03.iso / Quake3 Game Source / Q3AGameSource.exe / Main / ai_dmq3.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-18  |  4.8 KB  |  133 lines

  1. // Copyright (C) 1999-2000 Id Software, Inc.
  2. //
  3.  
  4. /*****************************************************************************
  5.  * name:        ai_dmq3.h
  6.  *
  7.  * desc:        Quake3 bot AI
  8.  *
  9.  * $Archive: /source/code/botai/ai_chat.c $
  10.  * $Author: Mrelusive $ 
  11.  * $Revision: 21 $
  12.  * $Modtime: 11/10/99 3:30p $
  13.  * $Date: 11/10/99 6:08p $
  14.  *
  15.  *****************************************************************************/
  16.  
  17. //setup the deathmatch AI
  18. void BotSetupDeathmatchAI(void);
  19. //shutdown the deathmatch AI
  20. void BotShutdownDeathmatchAI(void);
  21. //let the bot live within it's deathmatch AI net
  22. void BotDeathmatchAI(bot_state_t *bs, float thinktime);
  23. //free waypoints
  24. void BotFreeWaypoints(bot_waypoint_t *wp);
  25. //choose a weapon
  26. void BotChooseWeapon(bot_state_t *bs);
  27. //setup movement stuff
  28. void BotSetupForMovement(bot_state_t *bs);
  29. //update the inventory
  30. void BotUpdateInventory(bot_state_t *bs);
  31. //update the inventory during battle
  32. void BotUpdateBattleInventory(bot_state_t *bs, int enemy);
  33. //use holdable items during battle
  34. void BotBattleUseItems(bot_state_t *bs);
  35. //return true if the bot is dead
  36. qboolean BotIsDead(bot_state_t *bs);
  37. //returns true if the bot is in observer mode
  38. qboolean BotIsObserver(bot_state_t *bs);
  39. //returns true if the bot is in the intermission
  40. qboolean BotIntermission(bot_state_t *bs);
  41. //returns true if the bot is in lava or slime
  42. qboolean BotInLavaOrSlime(bot_state_t *bs);
  43. //returns true if the entity is dead
  44. qboolean EntityIsDead(aas_entityinfo_t *entinfo);
  45. //returns true if the entity is invisible
  46. qboolean EntityIsInvisible(aas_entityinfo_t *entinfo);
  47. //returns true if the entity is shooting
  48. qboolean EntityIsShooting(aas_entityinfo_t *entinfo);
  49. //returns the name of the client
  50. char *ClientName(int client, char *name, int size);
  51. //returns an simplyfied client name
  52. char *EasyClientName(int client, char *name, int size);
  53. //returns the skin used by the client
  54. char *ClientSkin(int client, char *skin, int size);
  55. //returns the aggression of the bot in the range [0, 100]
  56. float BotAggression(bot_state_t *bs);
  57. //returns true if the bot wants to retreat
  58. int BotWantsToRetreat(bot_state_t *bs);
  59. //returns true if the bot wants to chase
  60. int BotWantsToChase(bot_state_t *bs);
  61. //returns true if the bot wants to help
  62. int BotWantsToHelp(bot_state_t *bs);
  63. //returns true if the bot can and wants to rocketjump
  64. int BotCanAndWantsToRocketJump(bot_state_t *bs);
  65. //returns true if the bot wants to and goes camping
  66. int BotWantsToCamp(bot_state_t *bs);
  67. //the bot will perform attack movements
  68. bot_moveresult_t BotAttackMove(bot_state_t *bs, int tfl);
  69. //returns true if the bot and the entity are in the same team
  70. int BotSameTeam(bot_state_t *bs, int entnum);
  71. //returns true if teamplay is on
  72. int TeamPlayIsOn(void);
  73. //returns visible team mate flag carrier if available
  74. int BotTeamFlagCarrierVisible(bot_state_t *bs);
  75. //returns true and sets the .enemy field when an enemy is found
  76. int BotFindEnemy(bot_state_t *bs, int curenemy);
  77. //returns a roam goal
  78. void BotRoamGoal(bot_state_t *bs, vec3_t goal);
  79. //returns entity visibility in the range [0, 1]
  80. float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int ent);
  81. //the bot will aim at the current enemy
  82. void BotAimAtEnemy(bot_state_t *bs);
  83. //check if the bot should attack
  84. void BotCheckAttack(bot_state_t *bs);
  85. //AI when the bot is blocked
  86. void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate);
  87. //returns the CTF team the bot is in
  88. int BotCTFTeam(bot_state_t *bs);
  89. //returns the flag the bot is carrying (CTFFLAG_?)
  90. int BotCTFCarryingFlag(bot_state_t *bs);
  91. //set ctf goals (defend base, get enemy flag) during seek
  92. void BotCTFSeekGoals(bot_state_t *bs);
  93. //set ctf goals (defend base, get enemy flag) during retreat
  94. void BotCTFRetreatGoals(bot_state_t *bs);
  95. //create a new waypoint
  96. bot_waypoint_t *BotCreateWayPoint(char *name, vec3_t origin, int areanum);
  97. //find a waypoint with the given name
  98. bot_waypoint_t *BotFindWayPoint(bot_waypoint_t *waypoints, char *name);
  99. //strstr but case insensitive
  100. char *stristr(char *str, char *charset);
  101. //returns the number of the client with the given name
  102. int ClientFromName(char *name);
  103. //
  104. int BotPointAreaNum(vec3_t origin);
  105. //
  106. void BotMapScripts(bot_state_t *bs);
  107.  
  108. //ctf flags
  109. #define CTF_FLAG_NONE        0
  110. #define CTF_FLAG_RED        1
  111. #define CTF_FLAG_BLUE        2
  112. //CTF skins
  113. #define CTF_SKIN_REDTEAM    "red"
  114. #define CTF_SKIN_BLUETEAM    "blue"
  115. //CTF teams
  116. #define CTF_TEAM_NONE        0
  117. #define CTF_TEAM_RED        1
  118. #define CTF_TEAM_BLUE        2
  119.  
  120. extern int gametype;        //game type
  121. extern int maxclients;        //maximum number of clients
  122.  
  123. extern vmCvar_t bot_grapple;
  124. extern vmCvar_t bot_rocketjump;
  125. extern vmCvar_t bot_fastchat;
  126. extern vmCvar_t bot_nochat;
  127. extern vmCvar_t bot_testrchat;
  128. extern vmCvar_t bot_challenge;
  129.  
  130. extern bot_goal_t ctf_redflag;
  131. extern bot_goal_t ctf_blueflag;
  132.  
  133.